package cn.tedu.mybatis.mapper;

import cn.tedu.mybatis.pojo.comment;
import cn.tedu.mybatis.pojo.commentOV1;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface cmapper
{
    @Insert("INSERT INTO COMMENT(WEIBO_ID,USER_ID,CREATED,CONTENT) " +"VALUES(#{weiboid},#{userid},#{created},#{content})")
    int insertComment(comment comment);
    @Update("UPDATE COMMENT SET CONTENT=#{content} WHERE ID=#{id}")
    int updateComment(comment comment);
    @Delete("DELETE FROM COMMENT WHERE ID= #{id}")
    int deleteComment(Integer id);
    @Select("SELECT WEIBO_ID weiboid,USER_ID userid,CONTENT FROM COMMENT WHERE ID= #{id}")
    commentOV1 selectCommentById(Integer id);
    @Select("SELECT WEIBO_ID weiboid,USER_ID userid,CONTENT FROM COMMENT")
    List<commentOV1> selectComment();
    int  deleteComment2(Integer[] IDS);
    int updateComment2(comment comment);


}
